<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>鼠标事件</title>
</head>
<body>
<div id="app">
    <!--默认情况下， click 事件只处理 鼠标左键单击-->
    <div style="background-color: yellowgreen;" v-on:click="clicked"> 单击</div>
    <!--双击事件只定义了鼠标左键-->
    <div style="background-color: yellowgreen;" v-on:click="doubleclicked"> 单击</div>

    <!--鼠标移入-->
    <button v-on:mouseenter="enter">按钮1</button>
    <!--鼠标移出-->
    <button v-on:mouseleave="leave">按钮2</button>
    <!--鼠标悬停-->
    <button v-on:mouseover="hover">按钮3</button>



</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                function clicked(event) {
                    console.log(event);
                }

                function doubleclicked(event) {
                    console.log(event);
                }

                function enter(event) {
                    console.log(event);
                }

                function leave(event) {
                    console.log(event);
                }

                function hover(event) {
                    console.log(event);
                }

                return {
                    clicked,
                    doubleclicked,
                    enter,
                    leave,
                    hover,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>